﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CastleOfTheDisillusioned {
	public enum Direction {
		Left, Right, Up, Down
	}

	public static class Extensions {
		public static Direction Opposite(this Direction direction) {
			switch (direction) {
				case Direction.Left:
					return Direction.Right;
				case Direction.Right:
					return Direction.Left;
				case Direction.Up:
					return Direction.Down;
				case Direction.Down:
					return Direction.Up;

				//Just in case a new direction is added...
				default:
					throw new Exception("No opposite for direction: " + direction.ToString() + ". Please add one to Direction.cs");
			}
		}
	}
}
